<div class="page-title">

    <div class="title-env">
        <h1 class="title">积分查询</h1>
    </div>

    <div class="breadcrumb-env">

        <ol class="breadcrumb bc-1">
            <li>
                <a href="{:url('/')}"><i class="fa-home"></i>Home</a>
            </li>
            <li class="active">

                <strong>积分查询</strong>
            </li>
        </ol>

    </div>

</div>
<div class="panel panel-default">
    <form id="form1" action="" class="form form-inline">
        <input type="hidden" name="type" value="{$type}" id="search_type">
        <div class="form-group">
            <input class="form-control" type="text" name="uid" value="{$uid}">
        </div>
        <button style="margin-bottom: 0;" type="submit" class="btn btn-success">搜索</button>
    </form>
    <div class="panel-body">
        <div>
            <a href="javascript:void(0)" class="btn {eq name='$type' value='0'}btn-success{else/}btn-default{/eq}" onclick="form_submit(0)">总览</a>
            <a href="javascript:void(0)" class="btn {eq name='$type' value='1'}btn-success{else/}btn-default{/eq}" onclick="form_submit(1)">直推奖励</a>
            <a href="javascript:void(0)" class="btn {eq name='$type' value='2'}btn-success{else/}btn-default{/eq}" onclick="form_submit(2)">分红收入</a>
            <a href="javascript:void(0)" class="btn {eq name='$type' value='3'}btn-success{else/}btn-default{/eq}" onclick="form_submit(3)">助推奖励</a>
            <a href="javascript:void(0)" class="btn {eq name='$type' value='4'}btn-success{else/}btn-default{/eq}" onclick="form_submit(4)">转让出积分</a>
            <a href="javascript:void(0)" class="btn {eq name='$type' value='5'}btn-success{else/}btn-default{/eq}" onclick="form_submit(5)">转让入积分</a>
            <a href="javascript:void(0)" class="btn {eq name='$type' value='6'}btn-success{else/}btn-default{/eq}" onclick="form_submit(6)">提现积分</a>
        </div>
        <div>
            {eq name="code" value="0"}
                {$msg}
            {else/}
                {eq name="type" value="0"}
            <table class="table table-small-font table-bordered table-striped">
                <thead>
                    <tr>
                        <th>用户名</th>
                        <th>直推积分</th>
                        <th>分红收入</th>
                        <th>助推奖励</th>
                        <th>转让出积分</th>
                        <th>转让入积分</th>
                        <th>提现积分</th>
                        <th>总收入</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>{$user['username']}</td>
                        <td>{$finance[1]}</td>
                        <td>{$finance[2]}</td>
                        <td>{$finance[3]}</td>
                        <td>{$finance[4]}</td>
                        <td>{$finance[5]}</td>
                        <td>{$finance[6]}</td>
                        <td>{$total_amount}</td>
                    </tr>
                </tbody>
            </table>
                {else/}
            <table class="table table-small-font table-bordered table-striped">
                <thead>
                    <tr>
                        <th>用户名</th>
                        <th>总和</th>
                        <th>今日总和</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>{$user['username']}</td>
                        <td>{$total_amount}</td>
                        <td>{$today_amount}</td>
                    </tr>
                </tbody>
            </table>
            <div>
                <h3>明细</h3>
            </div>
            <table class="table table-small-font table-bordered table-striped">
                <thead>
                    <tr>
                        <th>时间</th>
                        <th>积分</th>
                    </tr>
                </thead>
                <tbody>
                    {volist name="finance" id="o"}
                    <tr>
                        <td>{:date('Y-m-d H:i:s', $o['changetime'])}</td>
                        <td>{$o['amount']}</td>
                    </tr>
                    {/volist}
                </tbody>
            </table>
                {$finance->render()}
                {/eq}
            {/eq}
        </div>
    </div>
</div>
<script>
    setTimeout("$('#alert').fadeOut(1000)",2000);
    function form_submit(type)
    {
        $('#search_type').val(type);
        $('#form1').submit();
    }
</script>